package com.recharge.domain.vo;

import com.recharge.common.domain.BaseDO;
import com.recharge.common.util.TemplateUtils;
import lombok.Data;

import java.util.List;

@Data
public class UserLoginDO extends BaseDO {

    private String merchantId;

    private String merchantName;

    private String username;

    private String password;

    private String oldPassword;

    private String salt;

    private Integer status;

    private String[] roleId;

    private UserDetailDO userDetailDO;

    private List<RoleDO> roles;

    private List<PermissionDO> permissiones;

    private String[] permissionCode;

    private List<MenuTreeDO> menuTree;

    public boolean registerVerification(){
        if (TemplateUtils.isEmpty(username) || username.length() > 30){return false;}
        if (TemplateUtils.isEmpty(password) || username.length() > 64){return false;}
        if (roleId == null || roleId.length == 0){return false;}
        if (userDetailDO == null || userDetailDO.getType() == null){return false;}
        return true;
    }

}
